elb-create-lb binoculars-elb --availability-zones us-east-1a --listener "protocol=http, lb-port=80, instance-port=8080"
elb-configure-healthcheck binoculars-elb --interval 30 --unhealthy-threshold 2 --healthy-threshold 2 --target "http:8080/d.txt" --timeout 3 --headers
#elb-register-instances-with-lb  binoculars-elb --instances i-21a8e248,i-0ba2e862
#elb-describe-instance-health  binoculars-elb


as-create-launch-config binoculars-cfg --image-id  ami-a98c6dc0  --instance-type m1.small --user-data-file start_jetty_auto_scale.sh --key epam
as-create-auto-scaling-group binoculars-grp --launch-configuration binoculars-cfg --availability-zones us-east-1a  --min-size 1 --max-size 3 --load-balancers binoculars-elb
as-update-auto-scaling-group binoculars-grp --min-size=2
#as-create-auto-scaling-group binoculars-grp --launch-configuration binoculars-cfg --availability-zones us-east-1a  --min-size 2 --max-size 2 --load-balancers binoculars-elb --cooldown 300
#as-create-or-update-trigger MyTrigger --auto-scaling-group binoculars-grp --namespace "AWS/EC2" --measure CPUUtilization --statistic Average --dimensions "AutoScalingGroupName=binoculars-grp" --period 60 --lower-threshold 40 --upper-threshold 80 --lower-breach-increment "-1" --upper-breach-increment "1" --breach-duration 600


as-describe-auto-scaling-groups 
as-describe-launch-configs
as-describe-scaling-activities binoculars-grp

# SHUT DOWN
as-update-auto-scaling-group binoculars-grp --max-size 0 --min-size=0
as-delete-auto-scaling-group binoculars-grp
as-delete-launch-config binoculars-cfg

